package com.customer.fegin;

import com.nameless.vo.Result;
import com.nameless.vo.pay.RequestParams;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.Map;

/**
 * -*- coding:utf-8 -*-
 *
 * @author 太阳偷渡青山
 * @software IntelliJ IDEA
 * @date 2023/03/05 15:39
 * @Description
 */
@FeignClient("car-payment")
public interface WeiXinPayFegin {
    /**
     * 创建订单并生成微信支付url
     *
     * @param requestParams 请求参数
     * @return {@link Result}<{@link Map}<{@link String},{@link Object}>>
     */
    @PostMapping("payment/weixin/createNative")
    Result<Map<String,Object>> createNative(@RequestBody RequestParams requestParams );

    /**
     * 查询支付状态
     *
     * @param orderNo 订单没有
     * @return {@link Result}<{@link String}>
     */
    @GetMapping("payment/weixin/queryPayStatus/{orderNo}")
    Result<String> queryPayStatus(@PathVariable String orderNo);

    /**
     * 支付现有订单
     *
     * @param requestParams 请求参数
     * @return {@link Result}<{@link Map}<{@link String},{@link Object}>>
     */
    @PostMapping("payment/weixin/payExistingOrder")
    Result<Map<String,Object>> payExistingOrder(@RequestBody RequestParams requestParams );

    /**
     * 阿里支付
     *
     * @param order 订单
     * @return {@link Result}<{@link String}>
     */
    @PostMapping("ali/payApp/createAliPay")
    Result<Map<String, Object>> createAliPay(@RequestBody RequestParams order);

    /**
     * 验证支付宝支付成功
     *
     * @param orderNo 订单没有
     * @return {@link Result}
     */
    @GetMapping("ali/payApp/return/{orderNo}")
    Result payReturn(@PathVariable String orderNo);
}
